<?php echo $header; ?>
<div id="content">
  <div class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
  </div>
  <?php if ($error_warning) { ?>
  <div class="warning"><?php echo $error_warning; ?></div>
  <?php } ?>

<?php echo $shortcut_route;?> 
  <div class="box">
    <div class="heading">
      <h1><img src="view/image/order.png" alt="" /> <?php echo $heading_title; ?></h1>
      <div class="buttons"><a onclick="$('#form').submit();" class="button"><span><?php echo $button_save; ?></span></a><a onclick="location = '<?php echo $cancel; ?>';" class="button"><span><?php echo $button_cancel; ?></span></a></div>
    </div>
    <div class="content">
      <div id="tabs" class="htabs">
      <a href="#tab-general"><?php echo $tab_general; ?></a>
      <a href="#tab-links"><?php echo $tab_links; ?></a>
      <a href="#tab-image"><?php echo $tab_image; ?></a>
      <a href="#tab-design"><?php echo $tab_design; ?></a>
      </div>
      <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form" name="form">
      <input type="hidden" name="article_id" value="<?php echo $article_id;?>" />
        <div id="tab-general">
         <table class="form">
            <tr>
              <td><?php echo $entry_author; ?></td>
              <td><select name="author_id">
                  <?php foreach ($authors as $author) { ?>
                  <?php if ($author['author_id'] == $author_id) { ?>
                  <option value="<?php echo $author['author_id']; ?>" selected="selected"><?php echo $author['author']; ?></option>
                  <?php } else { ?>
                  <option value="<?php echo $author['author_id']; ?>"><?php echo $author['author']; ?></option>
                  <?php } ?>
                  <?php } ?>
                  <option value="0"><?php echo $text_none; ?></option>
                </select>
                <?php if ($error_author) { ?>
                <span class="error"><?php echo $error_author; ?></span>
                <?php } ?></td>
            </tr>
            <tr>
              <td><?php echo $entry_image; ?></td>
              <td align="left"><div class="image" align="center" style="width:250px" ><img src="<?php echo $thumb; ?>" alt="" id="thumb" /><br />
                  <input type="hidden" name="image" value="<?php echo $image; ?>" id="image" />
                  <a onclick="image_upload('image', 'thumb');"><?php echo $text_browse; ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick="$('#thumb').attr('src', '<?php echo $no_image; ?>'); $('#image').attr('value', '');"><?php echo $text_clear; ?></a></div></td>
            </tr>
           
            <tr>
              <td><?php echo $entry_approved; ?></td>
              <td><select name="approved">
                  <?php if ($approved) { ?>
                  <option value="1" selected="selected"><?php echo $text_approved; ?></option>
                  <option value="0"><?php echo $text_unapproved; ?></option>
                  <?php } else { ?>
                  <option value="1"><?php echo $text_approved; ?></option>
                  <option value="0" selected="selected"><?php echo $text_unapproved; ?></option>
                  <?php } ?>
                </select></td>
            </tr>
            <tr>
              <td><?php echo $entry_status; ?></td>
              <td><select name="status">
                  <?php if ($status) { ?>
                  <option value="1" selected="selected"><?php echo $text_publish; ?></option>
                  <option value="0"><?php echo $text_unpublish; ?></option>
                  <?php } else { ?>
                  <option value="1"><?php echo $text_publish; ?></option>
                  <option value="0" selected="selected"><?php echo $text_unpublish; ?></option>
                  <?php } ?>
                </select></td>
            </tr>
            <tr>
              <td><?php echo $entry_sort_order; ?></td>
              <td><input type="text" name="sort_order" value="<?php echo $sort_order; ?>" size="2" /></td>
            </tr>
           <tr>
              <td><?php echo $entry_keyword; ?></td>
              <td><input type="text" name="keyword" id="keyword" value="<?php echo $keyword; ?>" size="50"/><a onclick="geturl('title','keyword','.html');" class="button"><span>Create</span></a>
              <?php if ($error_keyword) { ?>
               <br><span class="error"><?php echo $error_keyword; ?></span>
                <?php } ?></td>

            </tr>
            <tr>
              <td><?php echo $entry_reference_url; ?></td>
              <td><input type="text" name="reference_url"  value="<?php echo $reference_url; ?>" size="80"/></td>

            </tr>            
            <tr>
              <td><?php echo $entry_reference_title; ?></td>
              <td><input type="text" name="reference_title"  value="<?php echo $reference_title; ?>" size="80"/></td>
            </tr>
            </table>
          <div id="languages" class="htabs">
            <?php foreach ($languages as $language) { ?>
            <a href="#language<?php echo $language['language_id']; ?>"><img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" /> <?php echo $language['name']; ?></a>
            <?php } ?>
          </div>
          <?php foreach ($languages as $language) { ?>
          <div id="language<?php echo $language['language_id']; ?>">
            <table class="form">
              <tr>
                <td><span class="required">*</span> <?php echo $entry_name; ?></td>
                <td><input onkeyup="countChar(this,'title<?php echo $language['language_id']; ?>')" id="title" type="text" name="article_description[<?php echo $language['language_id']; ?>][name]" size="80" value="<?php echo isset($article_description[$language['language_id']]) ? $article_description[$language['language_id']]['name'] : ''; ?>"/>
                  <?php if (isset($error_name[$language['language_id']])) { ?>
                  <span class="error"><?php echo $error_name[$language['language_id']]; ?></span>
                  <?php }else{?><div class="error" id="num_title<?php echo $language['language_id']; ?>"></div><?php }?></td>
              </tr>
              <tr>
                <td><?php echo $entry_meta_keyword; ?></td>
                <td><textarea name="article_description[<?php echo $language['language_id']; ?>][meta_keyword]" cols="40" rows="5"><?php echo isset($article_description[$language['language_id']]) ? $article_description[$language['language_id']]['meta_keyword'] : ''; ?></textarea></td>
              </tr>
                <tr>
                <td><?php echo $entry_meta_description; ?></td>
                <td><textarea name="article_description[<?php echo $language['language_id']; ?>][meta_description]" cols="40" rows="5"><?php echo isset($article_description[$language['language_id']]) ? $article_description[$language['language_id']]['meta_description'] : ''; ?></textarea></td>
              </tr>
              
              
              <tr>
                <td><?php echo $entry_description; ?></td>
                <td><textarea  name="article_description[<?php echo $language['language_id']; ?>][description]" id="description<?php echo $language['language_id']; ?>" cols="40" rows="5"><?php echo isset($article_description[$language['language_id']]) ? $article_description[$language['language_id']]['description'] : ''; ?></textarea>
                </td>
              </tr>
              <tr>
                <td><?php echo $entry_tag; ?></td>
                <td><input type="text" name="article_description[<?php echo $language['language_id']; ?>][tag]" value="<?php echo isset($article_description[$language['language_id']]) ? $article_description[$language['language_id']]['tag'] : ''; ?>" size="80" /></td>
              </tr>
            </table>
          </div>
          <?php } ?>
        </div>              
           </table>
        <div id="tab-links">
          <table class="form">
          
            <tr>
              <td><?php echo $entry_poll; ?></td>
              <td><select name="poll_id">
                  <option value="0"><?php echo $text_none; ?></option>
                  <?php foreach ($polls as $poll) { ?>
                  <?php if ($poll['poll_id'] == $poll_id) { ?>
                  <option value="<?php echo $poll['poll_id']; ?>" selected="selected"><?php echo $poll['question']; ?></option>
                  <?php } else { ?>
                  <option value="<?php echo $poll['poll_id']; ?>"><?php echo $poll['question']; ?></option>
                  <?php } ?>
                  <?php } ?>
                </select></td>
            </tr>
            <tr>
              <td><?php echo $entry_category; ?></td>
              <td>               
              <div class="scrollbox" style="height:200px;">
                  <?php $class = 'odd'; ?>
                  <?php foreach ($categories as $category) { ?>
                  <?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
                  <div class="<?php echo $class; ?>">
                    <?php if (in_array($category['article_category_id'], $article_category)) { ?>
                    <input type="checkbox" name="article_category[]" value="<?php echo $category['article_category_id']; ?>" checked="checked" />
                    <?php echo $category['name']; ?>
                    <?php } else { ?>
                    <input type="checkbox" name="article_category[]" value="<?php echo $category['article_category_id']; ?>" />
                    <?php echo $category['name']; ?>
                    <?php } ?>
                  </div>
                  <?php } ?>
                </div>
                <a onclick="$(this).parent().find(':checkbox').attr('checked', true);"><?php echo $text_select_all; ?></a> / <a onclick="$(this).parent().find(':checkbox').attr('checked', false);"><?php echo $text_unselect_all; ?></a></td>
            </tr>
            <tr>
              <td><span style="color:#FF0000"><?php echo $entry_new_category;?></span></td>
              <td><input type="text" name="new_category" id="new_category" value="<?php echo $new_category; ?>" size="50"/>
              </td>
              </tr>
           <!-- -->
             <tr>
            <td><?php echo $entry_related_article; ?></td>
            <td>
            <table>
                <tr>
                  <td style="padding: 0;" colspan="3"><select id="article_category" style="margin-bottom: 5px;" onchange="getArticles();">
                      <?php foreach ($categories as $category) { ?>
                      <option value="<?php echo $category['article_category_id']; ?>"><?php echo $category['name']; ?> <?php echo $category['total']; ?></option>
                      <?php } ?>
                    </select></td>
                </tr>
                <tr>
                  <td style="padding: 0;"><select multiple="multiple" id="article" size="10" style="width: 350px;">
                    </select></td>
                  <td style="vertical-align: middle;"><input type="button" value="--&gt;" onclick="addArticleRelated();" />
                    <br />
                    <input type="button" value="&lt;--" onclick="removeArticleRelated();" /></td>
                  <td style="padding: 0;"><select multiple="multiple" id="article_related" size="10" style="width: 350px;">
                    </select></td>
                </tr>
              </table>
              <div id="related_article">
                <?php foreach ($related_article as $article_related_id) { ?>
                <input type="hidden" name="related_article[]" value="<?php echo $article_related_id; ?>" />
                <?php } ?>
              </div></td>
          </tr>
           <!-- -->
             <tr>
            <td><?php echo $entry_related_product; ?></td>
            <td><table>
                <tr>
                  <td style="padding: 0;" colspan="3"><select id="product_category" style="margin-bottom: 5px;" onchange="getProducts();">
                      <?php foreach ($product_categories as $product_category) { ?>
                      <option value="<?php echo $product_category['category_id']; ?>"><?php echo $product_category['name']; ?></option>
                      <?php } ?>
                    </select></td>
                </tr>
                <tr>
                  <td style="padding: 0;"><select multiple="multiple" id="product" size="10" style="width: 350px;">
                    </select></td>
                  <td style="vertical-align: middle;"><input type="button" value="--&gt;" onclick="addProductRelated();" />
                    <br />
                    <input type="button" value="&lt;--" onclick="removeProductRelated();" /></td>
                  <td style="padding: 0;"><select multiple="multiple" id="product_related" size="10" style="width: 350px;">
                    </select></td>
                </tr>
              </table>
              <div id="related_product">
                <?php foreach ($related_product as $product_related_id) { ?>
                <input type="hidden" name="related_product[]" value="<?php echo $product_related_id; ?>" />
                <?php } ?>
              </div></td>
          </tr>
            <tr>
              <td><?php echo $entry_store; ?></td>
              <td><div class="scrollbox">
                  <?php $class = 'even'; ?>
                  <div class="<?php echo $class; ?>">
                    <?php if (in_array(0, $article_store)) { ?>
                    <input type="checkbox" name="article_store[]" value="0" checked="checked" />
                    <?php echo $text_default; ?>
                    <?php } else { ?>
                    <input type="checkbox" name="article_store[]" value="0" />
                    <?php echo $text_default; ?>
                    <?php } ?>
                  </div>
                  <?php foreach ($stores as $store) { ?>
                  <?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
                  <div class="<?php echo $class; ?>">
                    <?php if (in_array($store['store_id'], $article_store)) { ?>
                    <input type="checkbox" name="article_store[]" value="<?php echo $store['store_id']; ?>" checked="checked" />
                    <?php echo $store['name']; ?>
                    <?php } else { ?>
                    <input type="checkbox" name="article_store[]" value="<?php echo $store['store_id']; ?>" />
                    <?php echo $store['name']; ?>
                    <?php } ?>
                  </div>
                  <?php } ?>
                </div></td>
            </tr>
            <tr>
              <td><?php echo $entry_download; ?></td>
              <td><div class="scrollbox" style="height:200px;">
                  <?php $class = 'odd'; ?>
                  <?php foreach ($downloads as $download) { ?>
                  <?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
                  <div class="<?php echo $class; ?>">
                    <?php if (in_array($download['download_id'], $article_download)) { ?>
                    <input type="checkbox" name="article_download[]" value="<?php echo $download['download_id']; ?>" checked="checked" />
                    <?php echo $download['name']; ?>
                    <?php } else { ?>
                    <input type="checkbox" name="article_download[]" value="<?php echo $download['download_id']; ?>" />
                    <?php echo $download['name']; ?>
                    <?php } ?>
                  </div>
                  <?php } ?>
                </div></td>
            </tr>
          </table>
        </div>
       <!-- --> 
        
         <div id="tab-image" class="htabs_content">
          <table id="image" class="list">
            <thead>
              <tr>
                <td class="left"><?php echo $entry_image;?></td>
                <td class="left"><?php echo $entry_sort_order;?></td>
                <td class="left">Image Description</td>
               <td class="right"><a onclick="addImage();" class="button"><?php echo $button_add_image;?></a></td>
              </tr>
          
            </thead>
            
            <?php $image_row = 0;?>
            <?php foreach($article_images as $article_image){?>
            <tbody id="image-row<?php echo $image_row;?>">
             
              <tr>
                <td align="center"><div class="image"><img src="<?php echo $article_image['thumb'];?>" alt="" id="thumb<?php echo $image_row;?>"  title="<?php echo $article_image['image'];?>"/><br/> 
                    
                    <a onclick="image_upload('image<?php echo $image_row;?>', 'thumb<?php echo $image_row;?>');"><?php echo $text_browse;?></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick="$('#thumb<?php echo $image_row;?>').attr('src', '<?php echo $no_image;?>');
		$('#image<?php echo $image_row;?>').attr('value', '');"><?php echo $text_clear;?></a> </div><br/> <input type="hidden" name="article_image[<?php echo $image_row;?>][image]" value="<?php echo $article_image['image'];?>" id="image<?php echo $image_row;?>"/></td> 
               
               <td align="center"><input type="text" style="width:20px" name="article_image[<?php echo $image_row;?>][sort_order]" value="<?php echo $article_image['sort_order'];?>" id="sort_order<?php echo $image_row;?>"/></td>
               
                <td class="left"><?php foreach($languages as $language){?>
                 <input type="text" name="article_image[<?php echo $image_row;?>][description][<?php echo $language['language_id'];?>][image_description]" value="<?php echo isset($article_image['description'][$language['language_id']]) ? $article_image['description'][$language['language_id']]['image_description'] : '';?>" style="width:400px"/>
                  <img src="view/image/flags/<?php echo $language['image'];?>" title="<?php echo $language['name'];?>" width="16px"/><br/>
                  <?php }?></td>
                <td class="right"><a onclick="$('#image-row<?php echo $image_row;?>').remove();" class="button"><span id="x144y120"></span><?php echo $button_remove;?></a></td>
              </tr>
            </tbody>
            <?php $image_row++;?>
            <?php }?>
            <tfoot>
              <tr>
              </tr>
            </tfoot>
          </table>
        </div>
        <!-- --> 
        
        
        <div id="tab-design">
          <table class="list">
            <thead>
              <tr>
                <td class="left"><?php echo $entry_store; ?></td>
                <td class="left"><?php echo $entry_layout; ?></td>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td class="left"><?php echo $text_default; ?></td>
                <td class="left"><select name="article_layout[0][layout_id]">
                    <option value=""></option>
                    <?php foreach ($layouts as $layout) { ?>
                    <?php if (isset($article_layout[0]) && $article_layout[0] == $layout['layout_id']) { ?>
                    <option value="<?php echo $layout['layout_id']; ?>" selected="selected"><?php echo $layout['name']; ?></option>
                    <?php } else { ?>
                    <option value="<?php echo $layout['layout_id']; ?>"><?php echo $layout['name']; ?></option>
                    <?php } ?>
                    <?php } ?>
                  </select></td>
              </tr>
            </tbody>
            <?php foreach ($stores as $store) { ?>
            <tbody>
              <tr>
                <td class="left"><?php echo $store['name']; ?></td>
                <td class="left"><select name="article_layout[<?php echo $store['store_id']; ?>][layout_id]">
                    <option value=""></option>
                    <?php foreach ($layouts as $layout) { ?>
                    <?php if (isset($article_layout[$store['store_id']]) && $article_layout[$store['store_id']] == $layout['layout_id']) { ?>
                    <option value="<?php echo $layout['layout_id']; ?>" selected="selected"><?php echo $layout['name']; ?></option>
                    <?php } else { ?>
                    <option value="<?php echo $layout['layout_id']; ?>"><?php echo $layout['name']; ?></option>
                    <?php } ?>
                    <?php } ?>
                  </select></td>
              </tr>
            </tbody>
            <?php } ?>
          </table>
        </div>
      </form>
    </div>
  </div>
</div>

<script type="text/javascript"><!--
function addProductRelated() {
	$('#product :selected').each(function() {
		$(this).remove();
		
		$('#product_related option[value=\'' + $(this).attr('value') + '\']').remove();
		
		$('#product_related').append('<option value="' + $(this).attr('value') + '">' + $(this).text() + '</option>');
		
		$('#related_product input[value=\'' + $(this).attr('value') + '\']').remove();
		
		$('#related_product').append('<input type="hidden" name="related_product[]" value="' + $(this).attr('value') + '" />');
	});
}

function removeProductRelated() {
	$('#product_related :selected').each(function() {
		$(this).remove();
		
		$('#related_product input[value=\'' + $(this).attr('value') + '\']').remove();
	});
}

function getProducts() {
	$('#product option').remove();
	
	$.ajax({
		url: 'index.php?route=news/article/product_category&token=<?php echo $token; ?>&category_id=' + $('#product_category').attr('value'),
		dataType: 'json',
		success: function(data) {
			for (i = 0; i < data.length; i++) {
	 			$('#product').append('<option value="' + data[i]['product_id'] + '">' + data[i]['name'] + '</option>');
			}
		}
	});
}

function getProductsRelated() {
	$('#product_related option').remove();	
	$.ajax({
		url: 'index.php?route=news/article/related_product&token=<?php echo $token; ?>',
		type: 'POST',
		dataType: 'json',
		data: $('#related_product input'),
		success: function(data) {
			$('#related_product input').remove();
			
			for (i = 0; i < data.length; i++) {
	 			$('#product_related').append('<option value="' + data[i]['product_id'] + '">' + data[i]['name'] + '</option>');
				
				$('#related_product').append('<input type="hidden" name="related_product[]" value="' + data[i]['product_id'] + '" />');
			} 
		}
	});
}

getProducts();
getProductsRelated();
//--></script>
<script type="text/javascript"><!--
function addArticleRelated() {
	$('#article :selected').each(function() {
		$(this).remove();
		
		$('#article_related option[value=\'' + $(this).attr('value') + '\']').remove();
		
		$('#article_related').append('<option value="' + $(this).attr('value') + '">' + $(this).text() + '</option>');
		
		$('#related_article input[value=\'' + $(this).attr('value') + '\']').remove();
		
		$('#related_article').append('<input type="hidden" name="related_article[]" value="' + $(this).attr('value') + '" />');
	});
}

function removeArticleRelated() {
	$('#article_related :selected').each(function() {
		$(this).remove();
		
		$('#related_article input[value=\'' + $(this).attr('value') + '\']').remove();
	});
}

function getArticles() {
	$('#article option').remove();
	
	$.ajax({
		url: 'index.php?route=news/article/article_category&token=<?php echo $token; ?>&article_category_id=' + $('#article_category').attr('value'),
		dataType: 'json',
		success: function(data) {
			for (i = 0; i < data.length; i++) {
	 			$('#article').append('<option value="' + data[i]['article_id'] + '">' + data[i]['name'] + '</option>');
			}
		}
	});
}

function getArticlesRelated() {
	$('#article_related option').remove();
	
	$.ajax({
		url: 'index.php?route=news/article/related_article&token=<?php echo $token; ?>',
		type: 'POST',
		dataType: 'json',
		data: $('#related_article input'),
		success: function(data) {
			$('#related_article input').remove();
			
			for (i = 0; i < data.length; i++) {
	 			$('#article_related').append('<option value="' + data[i]['article_id'] + '">' + data[i]['name'] + '</option>');
				
				$('#related_article').append('<input type="hidden" name="related_article[]" value="' + data[i]['article_id'] + '" />');
			} 
		}
	});
}

getArticles();
getArticlesRelated();
//--></script>
<script type="text/javascript" src="view/javascript/ckeditor/ckeditor.js"></script> 
<script type="text/javascript"><!--
<?php foreach ($languages as $language) { ?>
CKEDITOR.replace('description<?php echo $language['language_id']; ?>', {
	filebrowserBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
	filebrowserImageBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
	filebrowserFlashBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
	filebrowserUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
	filebrowserImageUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
	filebrowserFlashUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>'
});
<?php } ?>
//--></script> 
<script type="text/javascript"><!--
function image_upload(field, thumb) {
	$('#dialog').remove();
	
	$('#content').prepend('<div id="dialog" style="padding: 3px 0px 0px 0px;"><iframe src="index.php?route=common/filemanager&token=<?php echo $token; ?>&field=' + encodeURIComponent(field) + '" style="padding:0; margin: 0; display: block; width: 100%; height: 100%;" frameborder="no" scrolling="auto"></iframe></div>');
	
	$('#dialog').dialog({
		title: '<?php echo $text_image_manager; ?>',
		close: function (event, ui) {
			if ($('#' + field).attr('value')) {
				$.ajax({
					url: 'index.php?route=common/filemanager/image&token=<?php echo $token; ?>&image=' + encodeURIComponent($('#' + field).attr('value')),
					dataType: 'text',
					success: function(text) {
						$('#' + thumb).replaceWith('<img src="' + text + '" alt="" id="' + thumb + '" />');
					}
				});
			}
		},	
		bgiframe: false,
		width: 800,
		height: 400,
		resizable: false,
		modal: false
	});
};
//--></script> 

<script type="text/javascript">
var image_row = <?php echo $image_row;?>+1;
function addImage() {
	html  = '<tbody id="image-row' + image_row + '">';
    html += '  <tr>';
	html += '    <td align="center"><div class="image"><img src="<?php echo $no_image;?>" alt="" id="thumb' + image_row + '"/><br/> <a onclick="image_upload(\'image' + image_row + '\', \'thumb' + image_row + '\');"><?php echo $text_browse;?></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick="$(\'#thumb' + image_row + '\').attr(\'src\', \'<?php echo $no_image;?>\'); $(\'#image' + image_row + '\').attr(\'value\', \'\');"><?php echo $text_clear;?></a></div><br/><input type="hidden" name="article_image[' + image_row + '][image]" value="" id="image' + image_row + '"/></td>';
	html += '<td align="center"><input style="width:20px;" type="text" name="article_image[' + image_row + '][sort_order]" value="' + image_row + '" id="sort_order' + image_row + '"/></td>';
	html += '    <td class="left">';
	<?php foreach($languages as $language){?>
	html += '<input type="text" value="'+ image_row + '" name="article_image[' + image_row + '][description][<?php echo $language['language_id'];?>][image_description]"  style="width:400px"/><img src="view/image/flags/<?php echo $language['image'];?>" title="<?php echo $language['name'];?>" width="16px"/><br/>';
    <?php }?>
	html += '    </td>';
	html += '    <td class="right"><a onclick="$(\'#image-row' + image_row + '\').remove();" class="button"><span id="x144y120"></span><?php echo $button_remove;?></a></td>';
    html += '  </tr>';	
    html += '</tbody>';
	$('#image thead').after(html);
	image_row++;
}
</script>
<script type="text/javascript" src="view/javascript/jquery/ui/jquery-ui-timepicker-addon.js"></script> 
<script type="text/javascript"><!--
$('.date').datepicker({dateFormat: 'yy-mm-dd'});
$('.datetime').datetimepicker({
	dateFormat: 'yy-mm-dd',
	timeFormat: 'h:m'
});
$('.time').timepicker({timeFormat: 'h:m'});
//--></script> 
<script type="text/javascript"><!--
$('#tabs a').tabs(); 
$('#languages a').tabs(); 
$('#seo_languages a').tabs(); 
$('#vtab-option a').tabs();
//--></script> 
<script>
      function countChar(val,obj) {
        var len = val.value.length;
        var obj = obj;
        $('#num_'+obj).text(len);
      };
</script>
<?php echo $footer; ?>